import {createService } from "../request"
const rq = createService('/myapi')

// 获取用户列表，带分页
export function getUsersList(page, params, config) {
    return rq.get(
      `/admin/user/${page}`,
      params,
      config
    )
}

// 新增用户
export function addUser(form, config) {
  return rq.post(`/admin/user`, form, config)
}

// 修改用户
export function updateUserById(form, config) {
  return rq.post(`/admin/user/${form.id}`, form, config)
}

// 修改用户状态
export function updateUserStatusById(id, status, config) {
    return rq.post(`/admin/user/${id}/update_status`, {status}, config)
}

// 删除用户
export function deleteUserById(id, config) {
  return rq.post(`/admin/user/${id}/delete`, {}, config)
}
